package main

import "fmt"

// 利用匿名结构体模拟实现继承
type animal struct {
	color string
	breed string
}
type dog struct {
	animal
	name  string
	price int
}

func (d *dog) say() {
	fmt.Println(" my color is", d.color)
}
func main() {
	d1 := dog{animal: animal{"black", "边牧"}, name: "xxx", price: 1230}
	d1.say() //  my color is black
}
